<?php

class Row
{
	protected $iFeedId = null;

	protected $aFields = array();
	
	public function __construct($iFeedId)
	{
		$this->iFeedId = $iFeedId;
		$this->setFields();
	}
	
	protected function setFields()
	{
		/* SELECT * FROM fields WHERE feed_id = $this->iFeedId..... */
		$this->aFields = array();
	}
	
	public function getFields()
	{
		return $this->aFields;
	}
	
	public function addField($oField)
	{
		$this->aFields[] = $oField;
	}
	
	public function removeField($iFieldPosition)
	{
		/*TODO array_slice Funktion ist ungetestet */
		array_slice($this->aFields, $iFieldPosition, 1);
	}
	
	public function moveField($oField, $sDirection, $iMove)
	{
		// Hier muss die Logik rein, die die Positionen von Feldern tauscht, sodass man die 
		// Reihenfolge der Felder ändern kann
	}
	
	public function getFeedId()
	{
		return $this->iFeedId;
	}
	
}